﻿<div>
    <MTextField TValue="string"
                Rules="_rules"
                Label="Main input"
                HideDetails="@("auto")"></MTextField>
    <MTextField TValue="string"
                Label="Another input"></MTextField>
</div>

@code {
    private IEnumerable<Func<string, StringBoolean>> _rules = new List<Func<string, StringBoolean>>
        {
            value => !string.IsNullOrEmpty(value) ? true : "Required.",
            value => (!string.IsNullOrEmpty(value) && value.Length >= 3) ? true: "Min 3 characters"
        };
}